scheduler: Add a per-scheduler yield callback
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 9 Aug 2010 15:35:27 +0000 (16:35 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 9 Aug 2010 15:35:27 +0000 (16:35 +0100)
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/schedule.c
xen/include/xen/sched-if.h

index c3a897f5467c5aa94d1c28a833cd4f4d3957a1a0..497da1862c59d79b6215d328696183c98c1e7c65 100644 (file)
@@ -642,6 +642,12 @@ static long do_poll(struct sched_poll *sched_poll)
 /* Voluntarily yield the processor for this allocation. */
 static long do_yield(void)
 {
+    struct vcpu * v=current;
+
+    vcpu_schedule_lock_irq(v);
+    SCHED_OP(VCPU2OP(v), yield, v);
+    vcpu_schedule_unlock_irq(v);
+
     TRACE_2D(TRC_SCHED_YIELD, current->domain->domain_id, current->vcpu_id);
     raise_softirq(SCHEDULE_SOFTIRQ);
     return 0;
index 4fbf80c612922e50bf4b3b7b4b7038b0b5d54a64..3808344d11c2eb48727b726eaf2640c7c96ff9a2 100644 (file)
@@ -107,6 +107,7 @@ struct scheduler {
 
     void         (*sleep)          (const struct scheduler *, struct vcpu *);
     void         (*wake)           (const struct scheduler *, struct vcpu *);
+    void         (*yield)          (const struct scheduler *, struct vcpu *);
     void         (*context_saved)  (const struct scheduler *, struct vcpu *);
 
     struct task_slice (*do_schedule) (const struct scheduler *, s_time_t,